Integrand size = 45, antiderivative size = 597 \[ \int \frac {(a+b \tan (e+f x))^2 \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(c+d \tan (e+f x))^3} \, dx=-\frac {\left (b^2 \left (A c^3-c^3 C+3 B c^2 d-3 A c d^2+3 c C d^2-B d^3\right )+a^2 \left (c^3 C-3 B c^2 d-3 c C d^2+B d^3-A \left (c^3-3 c d^2\right )\right )-2 a b \left ((A-C) d \left (3 c^2-d^2\right )-B \left (c^3-3 c d^2\right )\right )\right ) x}{\left (c^2+d^2\right )^3}-\frac {\left (2 a b \left (A c^3-c^3 C+3 B c^2 d-3 A c d^2+3 c C d^2-B d^3\right )-a^2 \left ((A-C) d \left (3 c^2-d^2\right )-B \left (c^3-3 c d^2\right )\right )+b^2 \left ((A-C) d \left (3 c^2-d^2\right )-B \left (c^3-3 c d^2\right )\right )\right ) \log (\cos (e+f x))}{\left (c^2+d^2\right )^3 f}-\frac {\left (2 a b d^3 \left (A c^3-c^3 C+3 B c^2 d-3 A c d^2+3 c C d^2-B d^3\right )-b^2 \left (c^6 C+3 c^4 C d^2+B c^3 d^3-3 c^2 (A-2 C) d^4-3 B c d^5+A d^6\right )-a^2 d^3 \left ((A-C) d \left (3 c^2-d^2\right )-B \left (c^3-3 c d^2\right )\right )\right ) \log (c+d \tan (e+f x))}{d^3 \left (c^2+d^2\right )^3 f}-\frac {\left (c^2 C-B c d+A d^2\right ) (a+b \tan (e+f x))^2}{2 d \left (c^2+d^2\right ) f (c+d \tan (e+f x))^2}+\frac {(b c-a d) \left (b \left (c^4 C-c^2 (A-3 C) d^2-2 B c d^3+A d^4\right )+a d^2 \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )\right )}{d^3 \left (c^2+d^2\right )^2 f (c+d \tan (e+f x))} \]
[Out]
Time = 1.45 (sec) , antiderivative size = 597, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {3726, 3716, 3707, 3698, 31, 3556} \[ \int \frac {(a+b \tan (e+f x))^2 \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(c+d \tan (e+f x))^3} \, dx=-\frac {\log (\cos (e+f x)) \left (-\left (a^2 \left (d (A-C) \left (3 c^2-d^2\right )-B \left (c^3-3 c d^2\right )\right )\right )+2 a b \left (A c^3-3 A c d^2+3 B c^2 d-B d^3-c^3 C+3 c C d^2\right )+b^2 \left (d (A-C) \left (3 c^2-d^2\right )-B \left (c^3-3 c d^2\right )\right )\right )}{f \left (c^2+d^2\right )^3}-\frac {x \left (a^2 \left (-A \left (c^3-3 c d^2\right )-3 B c^2 d+B d^3+c^3 C-3 c C d^2\right )-2 a b \left (d (A-C) \left (3 c^2-d^2\right )-B \left (c^3-3 c d^2\right )\right )+b^2 \left (A c^3-3 A c d^2+3 B c^2 d-B d^3-c^3 C+3 c C d^2\right )\right )}{\left (c^2+d^2\right )^3}-\frac {\left (-a^2 d^3 \left (d (A-C) \left (3 c^2-d^2\right )-B \left (c^3-3 c d^2\right )\right )+2 a b d^3 \left (A c^3-3 A c d^2+3 B c^2 d-B d^3-c^3 C+3 c C d^2\right )-b^2 \left (-3 c^2 d^4 (A-2 C)+A d^6+B c^3 d^3-3 B c d^5+c^6 C+3 c^4 C d^2\right )\right ) \log (c+d \tan (e+f x))}{d^3 f \left (c^2+d^2\right )^3}-\frac {\left (A d^2-B c d+c^2 C\right ) (a+b \tan (e+f x))^2}{2 d f \left (c^2+d^2\right ) (c+d \tan (e+f x))^2}+\frac {(b c-a d) \left (a d^2 \left (2 c d (A-C)-B \left (c^2-d^2\right )\right )+b \left (-c^2 d^2 (A-3 C)+A d^4-2 B c d^3+c^4 C\right )\right )}{d^3 f \left (c^2+d^2\right )^2 (c+d \tan (e+f x))} \]
[In]
[Out]
Rule 31
Rule 3556
Rule 3698
Rule 3707
Rule 3716
Rule 3726
Rubi steps \begin{align*} \text {integral}& = -\frac {\left (c^2 C-B c d+A d^2\right ) (a+b \tan (e+f x))^2}{2 d \left (c^2+d^2\right ) f (c+d \tan (e+f x))^2}+\frac {\int \frac {(a+b \tan (e+f x)) \left (2 (A d (a c+b d)+(b c-a d) (c C-B d))+2 d ((A-C) (b c-a d)+B (a c+b d)) \tan (e+f x)+2 b C \left (c^2+d^2\right ) \tan ^2(e+f x)\right )}{(c+d \tan (e+f x))^2} \, dx}{2 d \left (c^2+d^2\right )} \\ & = -\frac {\left (c^2 C-B c d+A d^2\right ) (a+b \tan (e+f x))^2}{2 d \left (c^2+d^2\right ) f (c+d \tan (e+f x))^2}+\frac {(b c-a d) \left (b \left (c^4 C-c^2 (A-3 C) d^2-2 B c d^3+A d^4\right )+a d^2 \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )\right )}{d^3 \left (c^2+d^2\right )^2 f (c+d \tan (e+f x))}+\frac {\int \frac {2 \left (b^2 \left (c^4 C-c^2 (A-3 C) d^2-2 B c d^3+A d^4\right )-a^2 d^2 \left (c^2 C-2 B c d-C d^2-A \left (c^2-d^2\right )\right )+2 a b d^2 \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )\right )-2 d^2 \left (2 a b \left (c^2 C-2 B c d-C d^2-A \left (c^2-d^2\right )\right )+a^2 \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )-b^2 \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )\right ) \tan (e+f x)+2 b^2 C \left (c^2+d^2\right )^2 \tan ^2(e+f x)}{c+d \tan (e+f x)} \, dx}{2 d^2 \left (c^2+d^2\right )^2} \\ & = \frac {\left (a^2 \left (A c^3-c^3 C+3 B c^2 d-3 A c d^2+3 c C d^2-B d^3\right )+b^2 \left (c^3 C-3 B c^2 d-3 c C d^2+B d^3-A \left (c^3-3 c d^2\right )\right )+2 a b \left ((A-C) d \left (3 c^2-d^2\right )-B \left (c^3-3 c d^2\right )\right )\right ) x}{\left (c^2+d^2\right )^3}-\frac {\left (c^2 C-B c d+A d^2\right ) (a+b \tan (e+f x))^2}{2 d \left (c^2+d^2\right ) f (c+d \tan (e+f x))^2}+\frac {(b c-a d) \left (b \left (c^4 C-c^2 (A-3 C) d^2-2 B c d^3+A d^4\right )+a d^2 \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )\right )}{d^3 \left (c^2+d^2\right )^2 f (c+d \tan (e+f x))}+\frac {\left (2 a b \left (A c^3-c^3 C+3 B c^2 d-3 A c d^2+3 c C d^2-B d^3\right )-a^2 \left ((A-C) d \left (3 c^2-d^2\right )-B \left (c^3-3 c d^2\right )\right )+b^2 \left ((A-C) d \left (3 c^2-d^2\right )-B \left (c^3-3 c d^2\right )\right )\right ) \int \tan (e+f x) \, dx}{\left (c^2+d^2\right )^3}-\frac {\left (2 a b d^3 \left (A c^3-c^3 C+3 B c^2 d-3 A c d^2+3 c C d^2-B d^3\right )-b^2 \left (c^6 C+3 c^4 C d^2+B c^3 d^3-3 c^2 (A-2 C) d^4-3 B c d^5+A d^6\right )-a^2 d^3 \left ((A-C) d \left (3 c^2-d^2\right )-B \left (c^3-3 c d^2\right )\right )\right ) \int \frac {1+\tan ^2(e+f x)}{c+d \tan (e+f x)} \, dx}{d^2 \left (c^2+d^2\right )^3} \\ & = \frac {\left (a^2 \left (A c^3-c^3 C+3 B c^2 d-3 A c d^2+3 c C d^2-B d^3\right )+b^2 \left (c^3 C-3 B c^2 d-3 c C d^2+B d^3-A \left (c^3-3 c d^2\right )\right )+2 a b \left ((A-C) d \left (3 c^2-d^2\right )-B \left (c^3-3 c d^2\right )\right )\right ) x}{\left (c^2+d^2\right )^3}-\frac {\left (2 a b \left (A c^3-c^3 C+3 B c^2 d-3 A c d^2+3 c C d^2-B d^3\right )-a^2 \left ((A-C) d \left (3 c^2-d^2\right )-B \left (c^3-3 c d^2\right )\right )+b^2 \left ((A-C) d \left (3 c^2-d^2\right )-B \left (c^3-3 c d^2\right )\right )\right ) \log (\cos (e+f x))}{\left (c^2+d^2\right )^3 f}-\frac {\left (c^2 C-B c d+A d^2\right ) (a+b \tan (e+f x))^2}{2 d \left (c^2+d^2\right ) f (c+d \tan (e+f x))^2}+\frac {(b c-a d) \left (b \left (c^4 C-c^2 (A-3 C) d^2-2 B c d^3+A d^4\right )+a d^2 \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )\right )}{d^3 \left (c^2+d^2\right )^2 f (c+d \tan (e+f x))}-\frac {\left (2 a b d^3 \left (A c^3-c^3 C+3 B c^2 d-3 A c d^2+3 c C d^2-B d^3\right )-b^2 \left (c^6 C+3 c^4 C d^2+B c^3 d^3-3 c^2 (A-2 C) d^4-3 B c d^5+A d^6\right )-a^2 d^3 \left ((A-C) d \left (3 c^2-d^2\right )-B \left (c^3-3 c d^2\right )\right )\right ) \text {Subst}\left (\int \frac {1}{c+x} \, dx,x,d \tan (e+f x)\right )}{d^3 \left (c^2+d^2\right )^3 f} \\ & = \frac {\left (a^2 \left (A c^3-c^3 C+3 B c^2 d-3 A c d^2+3 c C d^2-B d^3\right )+b^2 \left (c^3 C-3 B c^2 d-3 c C d^2+B d^3-A \left (c^3-3 c d^2\right )\right )+2 a b \left ((A-C) d \left (3 c^2-d^2\right )-B \left (c^3-3 c d^2\right )\right )\right ) x}{\left (c^2+d^2\right )^3}-\frac {\left (2 a b \left (A c^3-c^3 C+3 B c^2 d-3 A c d^2+3 c C d^2-B d^3\right )-a^2 \left ((A-C) d \left (3 c^2-d^2\right )-B \left (c^3-3 c d^2\right )\right )+b^2 \left ((A-C) d \left (3 c^2-d^2\right )-B \left (c^3-3 c d^2\right )\right )\right ) \log (\cos (e+f x))}{\left (c^2+d^2\right )^3 f}-\frac {\left (2 a b d^3 \left (A c^3-c^3 C+3 B c^2 d-3 A c d^2+3 c C d^2-B d^3\right )-b^2 \left (c^6 C+3 c^4 C d^2+B c^3 d^3-3 c^2 (A-2 C) d^4-3 B c d^5+A d^6\right )-a^2 d^3 \left ((A-C) d \left (3 c^2-d^2\right )-B \left (c^3-3 c d^2\right )\right )\right ) \log (c+d \tan (e+f x))}{d^3 \left (c^2+d^2\right )^3 f}-\frac {\left (c^2 C-B c d+A d^2\right ) (a+b \tan (e+f x))^2}{2 d \left (c^2+d^2\right ) f (c+d \tan (e+f x))^2}+\frac {(b c-a d) \left (b \left (c^4 C-c^2 (A-3 C) d^2-2 B c d^3+A d^4\right )+a d^2 \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )\right )}{d^3 \left (c^2+d^2\right )^2 f (c+d \tan (e+f x))} \\ \end{align*}
Result contains complex when optimal does not.
Time = 6.98 (sec) , antiderivative size = 1044, normalized size of antiderivative = 1.75 \[ \int \frac {(a+b \tan (e+f x))^2 \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(c+d \tan (e+f x))^3} \, dx=-\frac {\left (-2 a A b c^3-a^2 B c^3+b^2 B c^3+2 a b c^3 C+3 a^2 A c^2 d-3 A b^2 c^2 d-6 a b B c^2 d-3 a^2 c^2 C d+3 b^2 c^2 C d+6 a A b c d^2+3 a^2 B c d^2-3 b^2 B c d^2-6 a b c C d^2-a^2 A d^3+A b^2 d^3+2 a b B d^3+a^2 C d^3-b^2 C d^3+i \left (a^2 A c^3-A b^2 c^3-2 a b B c^3-a^2 c^3 C+b^2 c^3 C+6 a A b c^2 d+3 a^2 B c^2 d-3 b^2 B c^2 d-6 a b c^2 C d-3 a^2 A c d^2+3 A b^2 c d^2+6 a b B c d^2+3 a^2 c C d^2-3 b^2 c C d^2-2 a A b d^3-a^2 B d^3+b^2 B d^3+2 a b C d^3\right )\right ) \log (i-\tan (e+f x))}{2 \left (c^2+d^2\right )^3 f}+\frac {\left (2 a A b c^3+a^2 B c^3-b^2 B c^3-2 a b c^3 C-3 a^2 A c^2 d+3 A b^2 c^2 d+6 a b B c^2 d+3 a^2 c^2 C d-3 b^2 c^2 C d-6 a A b c d^2-3 a^2 B c d^2+3 b^2 B c d^2+6 a b c C d^2+a^2 A d^3-A b^2 d^3-2 a b B d^3-a^2 C d^3+b^2 C d^3+i \left (a^2 A c^3-A b^2 c^3-2 a b B c^3-a^2 c^3 C+b^2 c^3 C+6 a A b c^2 d+3 a^2 B c^2 d-3 b^2 B c^2 d-6 a b c^2 C d-3 a^2 A c d^2+3 A b^2 c d^2+6 a b B c d^2+3 a^2 c C d^2-3 b^2 c C d^2-2 a A b d^3-a^2 B d^3+b^2 B d^3+2 a b C d^3\right )\right ) \log (i+\tan (e+f x))}{2 \left (c^2+d^2\right )^3 f}-\frac {\left (2 a b d^3 \left (A c^3-c^3 C+3 B c^2 d-3 A c d^2+3 c C d^2-B d^3\right )-b^2 \left (c^6 C+3 c^4 C d^2+B c^3 d^3-3 c^2 (A-2 C) d^4-3 B c d^5+A d^6\right )-a^2 d^3 \left ((A-C) d \left (3 c^2-d^2\right )-B \left (c^3-3 c d^2\right )\right )\right ) \log (c+d \tan (e+f x))}{d^3 \left (c^2+d^2\right )^3 f}-\frac {(b c-a d)^2 \left (c^2 C-B c d+A d^2\right )}{2 d^3 \left (c^2+d^2\right ) f (c+d \tan (e+f x))^2}+\frac {(b c-a d) \left (b \left (2 c^4 C-B c^3 d+4 c^2 C d^2-3 B c d^3+2 A d^4\right )+a d^2 \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )\right )}{d^3 \left (c^2+d^2\right )^2 f (c+d \tan (e+f x))} \]
[In]
[Out]
Time = 0.40 (sec) , antiderivative size = 865, normalized size of antiderivative = 1.45
method | result | size |
derivativedivides | \(\frac {\frac {\frac {\left (-3 A \,a^{2} c^{2} d +A \,a^{2} d^{3}+2 A a b \,c^{3}-6 A a b c \,d^{2}+3 A \,b^{2} c^{2} d -A \,b^{2} d^{3}+B \,a^{2} c^{3}-3 B \,a^{2} c \,d^{2}+6 B a b \,c^{2} d -2 B a b \,d^{3}-B \,b^{2} c^{3}+3 B \,b^{2} c \,d^{2}+3 C \,a^{2} c^{2} d -C \,a^{2} d^{3}-2 C a b \,c^{3}+6 C a b c \,d^{2}-3 C \,b^{2} c^{2} d +C \,b^{2} d^{3}\right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}+\left (A \,a^{2} c^{3}-3 A \,a^{2} c \,d^{2}+6 A a b \,c^{2} d -2 A a b \,d^{3}-A \,b^{2} c^{3}+3 A \,b^{2} c \,d^{2}+3 B \,a^{2} c^{2} d -B \,a^{2} d^{3}-2 B a b \,c^{3}+6 B a b c \,d^{2}-3 B \,b^{2} c^{2} d +B \,b^{2} d^{3}-C \,a^{2} c^{3}+3 C \,a^{2} c \,d^{2}-6 C a b \,c^{2} d +2 C a b \,d^{3}+C \,b^{2} c^{3}-3 C \,b^{2} c \,d^{2}\right ) \arctan \left (\tan \left (f x +e \right )\right )}{\left (c^{2}+d^{2}\right )^{3}}-\frac {A \,a^{2} d^{4}-2 A a b c \,d^{3}+A \,b^{2} c^{2} d^{2}-B \,a^{2} c \,d^{3}+2 B a b \,c^{2} d^{2}-B \,b^{2} c^{3} d +C \,a^{2} c^{2} d^{2}-2 C a b \,c^{3} d +C \,b^{2} c^{4}}{2 d^{3} \left (c^{2}+d^{2}\right ) \left (c +d \tan \left (f x +e \right )\right )^{2}}-\frac {2 A \,a^{2} c \,d^{4}-2 A a b \,c^{2} d^{3}+2 A a b \,d^{5}-2 A \,b^{2} c \,d^{4}-B \,a^{2} c^{2} d^{3}+B \,a^{2} d^{5}-4 B a b c \,d^{4}+B \,b^{2} c^{4} d +3 B \,b^{2} c^{2} d^{3}-2 C \,a^{2} c \,d^{4}+2 C a b \,c^{4} d +6 C a b \,c^{2} d^{3}-2 C \,b^{2} c^{5}-4 C \,b^{2} c^{3} d^{2}}{d^{3} \left (c^{2}+d^{2}\right )^{2} \left (c +d \tan \left (f x +e \right )\right )}+\frac {\left (3 A \,a^{2} c^{2} d^{4}-A \,a^{2} d^{6}-2 A a b \,c^{3} d^{3}+6 A a b \,d^{5} c -3 A \,b^{2} c^{2} d^{4}+A \,b^{2} d^{6}-B \,a^{2} c^{3} d^{3}+3 a^{2} d^{5} B c -6 B a b \,c^{2} d^{4}+2 B a b \,d^{6}+B \,b^{2} c^{3} d^{3}-3 B \,b^{2} c \,d^{5}-3 C \,a^{2} c^{2} d^{4}+C \,a^{2} d^{6}+2 C a b \,c^{3} d^{3}-6 C a b c \,d^{5}+C \,b^{2} c^{6}+3 C \,b^{2} c^{4} d^{2}+6 C \,b^{2} c^{2} d^{4}\right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{\left (c^{2}+d^{2}\right )^{3} d^{3}}}{f}\) | \(865\) |
default | \(\frac {\frac {\frac {\left (-3 A \,a^{2} c^{2} d +A \,a^{2} d^{3}+2 A a b \,c^{3}-6 A a b c \,d^{2}+3 A \,b^{2} c^{2} d -A \,b^{2} d^{3}+B \,a^{2} c^{3}-3 B \,a^{2} c \,d^{2}+6 B a b \,c^{2} d -2 B a b \,d^{3}-B \,b^{2} c^{3}+3 B \,b^{2} c \,d^{2}+3 C \,a^{2} c^{2} d -C \,a^{2} d^{3}-2 C a b \,c^{3}+6 C a b c \,d^{2}-3 C \,b^{2} c^{2} d +C \,b^{2} d^{3}\right ) \ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2}+\left (A \,a^{2} c^{3}-3 A \,a^{2} c \,d^{2}+6 A a b \,c^{2} d -2 A a b \,d^{3}-A \,b^{2} c^{3}+3 A \,b^{2} c \,d^{2}+3 B \,a^{2} c^{2} d -B \,a^{2} d^{3}-2 B a b \,c^{3}+6 B a b c \,d^{2}-3 B \,b^{2} c^{2} d +B \,b^{2} d^{3}-C \,a^{2} c^{3}+3 C \,a^{2} c \,d^{2}-6 C a b \,c^{2} d +2 C a b \,d^{3}+C \,b^{2} c^{3}-3 C \,b^{2} c \,d^{2}\right ) \arctan \left (\tan \left (f x +e \right )\right )}{\left (c^{2}+d^{2}\right )^{3}}-\frac {A \,a^{2} d^{4}-2 A a b c \,d^{3}+A \,b^{2} c^{2} d^{2}-B \,a^{2} c \,d^{3}+2 B a b \,c^{2} d^{2}-B \,b^{2} c^{3} d +C \,a^{2} c^{2} d^{2}-2 C a b \,c^{3} d +C \,b^{2} c^{4}}{2 d^{3} \left (c^{2}+d^{2}\right ) \left (c +d \tan \left (f x +e \right )\right )^{2}}-\frac {2 A \,a^{2} c \,d^{4}-2 A a b \,c^{2} d^{3}+2 A a b \,d^{5}-2 A \,b^{2} c \,d^{4}-B \,a^{2} c^{2} d^{3}+B \,a^{2} d^{5}-4 B a b c \,d^{4}+B \,b^{2} c^{4} d +3 B \,b^{2} c^{2} d^{3}-2 C \,a^{2} c \,d^{4}+2 C a b \,c^{4} d +6 C a b \,c^{2} d^{3}-2 C \,b^{2} c^{5}-4 C \,b^{2} c^{3} d^{2}}{d^{3} \left (c^{2}+d^{2}\right )^{2} \left (c +d \tan \left (f x +e \right )\right )}+\frac {\left (3 A \,a^{2} c^{2} d^{4}-A \,a^{2} d^{6}-2 A a b \,c^{3} d^{3}+6 A a b \,d^{5} c -3 A \,b^{2} c^{2} d^{4}+A \,b^{2} d^{6}-B \,a^{2} c^{3} d^{3}+3 a^{2} d^{5} B c -6 B a b \,c^{2} d^{4}+2 B a b \,d^{6}+B \,b^{2} c^{3} d^{3}-3 B \,b^{2} c \,d^{5}-3 C \,a^{2} c^{2} d^{4}+C \,a^{2} d^{6}+2 C a b \,c^{3} d^{3}-6 C a b c \,d^{5}+C \,b^{2} c^{6}+3 C \,b^{2} c^{4} d^{2}+6 C \,b^{2} c^{2} d^{4}\right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{\left (c^{2}+d^{2}\right )^{3} d^{3}}}{f}\) | \(865\) |
norman | \(\text {Expression too large to display}\) | \(1444\) |
risch | \(\text {Expression too large to display}\) | \(4025\) |
parallelrisch | \(\text {Expression too large to display}\) | \(4621\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 1618 vs. \(2 (591) = 1182\).
Time = 0.65 (sec) , antiderivative size = 1618, normalized size of antiderivative = 2.71 \[ \int \frac {(a+b \tan (e+f x))^2 \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(c+d \tan (e+f x))^3} \, dx=\text {Too large to display} \]
[In]
[Out]
Exception generated. \[ \int \frac {(a+b \tan (e+f x))^2 \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(c+d \tan (e+f x))^3} \, dx=\text {Exception raised: AttributeError} \]
[In]
[Out]
none
Time = 0.34 (sec) , antiderivative size = 827, normalized size of antiderivative = 1.39 \[ \int \frac {(a+b \tan (e+f x))^2 \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(c+d \tan (e+f x))^3} \, dx=\frac {\frac {2 \, {\left ({\left ({\left (A - C\right )} a^{2} - 2 \, B a b - {\left (A - C\right )} b^{2}\right )} c^{3} + 3 \, {\left (B a^{2} + 2 \, {\left (A - C\right )} a b - B b^{2}\right )} c^{2} d - 3 \, {\left ({\left (A - C\right )} a^{2} - 2 \, B a b - {\left (A - C\right )} b^{2}\right )} c d^{2} - {\left (B a^{2} + 2 \, {\left (A - C\right )} a b - B b^{2}\right )} d^{3}\right )} {\left (f x + e\right )}}{c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}} + \frac {2 \, {\left (C b^{2} c^{6} + 3 \, C b^{2} c^{4} d^{2} - {\left (B a^{2} + 2 \, {\left (A - C\right )} a b - B b^{2}\right )} c^{3} d^{3} + 3 \, {\left ({\left (A - C\right )} a^{2} - 2 \, B a b - {\left (A - 2 \, C\right )} b^{2}\right )} c^{2} d^{4} + 3 \, {\left (B a^{2} + 2 \, {\left (A - C\right )} a b - B b^{2}\right )} c d^{5} - {\left ({\left (A - C\right )} a^{2} - 2 \, B a b - A b^{2}\right )} d^{6}\right )} \log \left (d \tan \left (f x + e\right ) + c\right )}{c^{6} d^{3} + 3 \, c^{4} d^{5} + 3 \, c^{2} d^{7} + d^{9}} + \frac {{\left ({\left (B a^{2} + 2 \, {\left (A - C\right )} a b - B b^{2}\right )} c^{3} - 3 \, {\left ({\left (A - C\right )} a^{2} - 2 \, B a b - {\left (A - C\right )} b^{2}\right )} c^{2} d - 3 \, {\left (B a^{2} + 2 \, {\left (A - C\right )} a b - B b^{2}\right )} c d^{2} + {\left ({\left (A - C\right )} a^{2} - 2 \, B a b - {\left (A - C\right )} b^{2}\right )} d^{3}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}} + \frac {3 \, C b^{2} c^{6} - A a^{2} d^{6} - {\left (2 \, C a b + B b^{2}\right )} c^{5} d - {\left (C a^{2} + 2 \, B a b + {\left (A - 7 \, C\right )} b^{2}\right )} c^{4} d^{2} + {\left (3 \, B a^{2} + 2 \, {\left (3 \, A - 5 \, C\right )} a b - 5 \, B b^{2}\right )} c^{3} d^{3} - {\left ({\left (5 \, A - 3 \, C\right )} a^{2} - 6 \, B a b - 3 \, A b^{2}\right )} c^{2} d^{4} - {\left (B a^{2} + 2 \, A a b\right )} c d^{5} + 2 \, {\left (2 \, C b^{2} c^{5} d + 4 \, C b^{2} c^{3} d^{3} - {\left (2 \, C a b + B b^{2}\right )} c^{4} d^{2} + {\left (B a^{2} + 2 \, {\left (A - 3 \, C\right )} a b - 3 \, B b^{2}\right )} c^{2} d^{4} - 2 \, {\left ({\left (A - C\right )} a^{2} - 2 \, B a b - A b^{2}\right )} c d^{5} - {\left (B a^{2} + 2 \, A a b\right )} d^{6}\right )} \tan \left (f x + e\right )}{c^{6} d^{3} + 2 \, c^{4} d^{5} + c^{2} d^{7} + {\left (c^{4} d^{5} + 2 \, c^{2} d^{7} + d^{9}\right )} \tan \left (f x + e\right )^{2} + 2 \, {\left (c^{5} d^{4} + 2 \, c^{3} d^{6} + c d^{8}\right )} \tan \left (f x + e\right )}}{2 \, f} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 1663 vs. \(2 (591) = 1182\).
Time = 1.05 (sec) , antiderivative size = 1663, normalized size of antiderivative = 2.79 \[ \int \frac {(a+b \tan (e+f x))^2 \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(c+d \tan (e+f x))^3} \, dx=\text {Too large to display} \]
[In]
[Out]
Time = 27.06 (sec) , antiderivative size = 807, normalized size of antiderivative = 1.35 \[ \int \frac {(a+b \tan (e+f x))^2 \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(c+d \tan (e+f x))^3} \, dx=-\frac {\frac {A\,a^2\,d^6-3\,C\,b^2\,c^6+B\,a^2\,c\,d^5+B\,b^2\,c^5\,d+5\,A\,a^2\,c^2\,d^4-3\,A\,b^2\,c^2\,d^4+A\,b^2\,c^4\,d^2-3\,B\,a^2\,c^3\,d^3+5\,B\,b^2\,c^3\,d^3-3\,C\,a^2\,c^2\,d^4+C\,a^2\,c^4\,d^2-7\,C\,b^2\,c^4\,d^2+2\,A\,a\,b\,c\,d^5+2\,C\,a\,b\,c^5\,d-6\,A\,a\,b\,c^3\,d^3-6\,B\,a\,b\,c^2\,d^4+2\,B\,a\,b\,c^4\,d^2+10\,C\,a\,b\,c^3\,d^3}{2\,d^3\,\left (c^4+2\,c^2\,d^2+d^4\right )}+\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (B\,a^2\,d^5-2\,C\,b^2\,c^5+2\,A\,a\,b\,d^5+2\,A\,a^2\,c\,d^4-2\,A\,b^2\,c\,d^4+B\,b^2\,c^4\,d-2\,C\,a^2\,c\,d^4-B\,a^2\,c^2\,d^3+3\,B\,b^2\,c^2\,d^3-4\,C\,b^2\,c^3\,d^2-4\,B\,a\,b\,c\,d^4+2\,C\,a\,b\,c^4\,d-2\,A\,a\,b\,c^2\,d^3+6\,C\,a\,b\,c^2\,d^3\right )}{d^2\,\left (c^4+2\,c^2\,d^2+d^4\right )}}{f\,\left (c^2+2\,c\,d\,\mathrm {tan}\left (e+f\,x\right )+d^2\,{\mathrm {tan}\left (e+f\,x\right )}^2\right )}-\frac {\ln \left (c+d\,\mathrm {tan}\left (e+f\,x\right )\right )\,\left (\frac {c^2\,\left (d^4\,\left (3\,A\,b^2-3\,A\,a^2+3\,C\,a^2-6\,C\,b^2+6\,B\,a\,b\right )+3\,C\,b^2\,d^4\right )-d^6\,\left (A\,b^2-A\,a^2+C\,a^2+2\,B\,a\,b\right )+C\,b^2\,d^6-c\,d^5\,\left (3\,B\,a^2-3\,B\,b^2+6\,A\,a\,b-6\,C\,a\,b\right )+c^3\,d^3\,\left (B\,a^2-B\,b^2+2\,A\,a\,b-2\,C\,a\,b\right )}{c^6\,d^3+3\,c^4\,d^5+3\,c^2\,d^7+d^9}-\frac {C\,b^2}{d^3}\right )}{f}-\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )\,\left (B\,a^2-B\,b^2+2\,A\,a\,b-2\,C\,a\,b-A\,a^2\,1{}\mathrm {i}+A\,b^2\,1{}\mathrm {i}+C\,a^2\,1{}\mathrm {i}-C\,b^2\,1{}\mathrm {i}+B\,a\,b\,2{}\mathrm {i}\right )}{2\,f\,\left (-c^3-c^2\,d\,3{}\mathrm {i}+3\,c\,d^2+d^3\,1{}\mathrm {i}\right )}-\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\left (A\,b^2-A\,a^2+B\,a^2\,1{}\mathrm {i}-B\,b^2\,1{}\mathrm {i}+C\,a^2-C\,b^2+A\,a\,b\,2{}\mathrm {i}+2\,B\,a\,b-C\,a\,b\,2{}\mathrm {i}\right )}{2\,f\,\left (-c^3\,1{}\mathrm {i}-3\,c^2\,d+c\,d^2\,3{}\mathrm {i}+d^3\right )} \]
[In]
[Out]